package com.kpmg.datalake.accountcheck.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.github.pagehelper.PageInfo;
import com.kpmg.datalake.accountcheck.vo.*;
import com.kpmg.datalake.common.vo.GeneralHeaderVO;
import com.kpmg.datalake.common.vo.ServerResponse;
import java.util.ArrayList;
import java.util.Map;
import jxl.write.WriteException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @author Echo
 * @create 2018-05-18
 * @desc 内部对账相关Service
 */
public interface AccountCheckService {

  ServerResponse<PageInfo> getCourseList(int page, int size, String projectId, String corpCode,
      String queryParam);

  void exportAccountReport(String projectId, String fileName, AccountQueryVO accountQueryVO,
      HttpServletRequest request, HttpServletResponse response) throws WriteException, IOException;

  ServerResponse<JSONObject> addManualRow(AccountCondition accountCondition, String projectId);

  ServerResponse<JSONObject> deleteManualRow(AccountRowDeleteVO accountRowDeleteVO, String projectId);

  /**
   * 根据用户名/项目Id和对应报告的参数,获得内部对账数据
   *
   * @param username 用户名
   * @param projectId 项目Id
   * @param accountQueryVO 报告的条件
   * @param num 用户分页
   */
  ServerResponse getChkAccountData(String username, String projectId,
      AccountQueryVO accountQueryVO, int num);

  ServerResponse<JSONObject> getChkAccountData(String projectId, AccountQueryVO accountQueryVO, int num,
      String offsetType);


  ServerResponse getCstMapping(String projectId, String param, int page, int size);

  ServerResponse updateCstMapping(String projectId, String code, String value, String corpCd,
      String corpNm);

  ServerResponse getCourseByType(int page, int size, String projectId, List<String> types,
      String code, String value, String param);

  ServerResponse addRuleRow(AccountSubCondition accountSubCondition, String projectId);

  ServerResponse deleteRuleRow(String matchId, String projectId);

  ServerResponse updateRuleAllRow(AccountSubCondition accountSubCondition, String projectId);

  ServerResponse moveAccountSubHeader(AccountCheckChangeRowVO matchIds, String projectId);

  ServerResponse getSubMatchAndDetailMapping(String projectId, String param, int page, int size);

  void executeAccountCheckHandler(String projectId, String year, int startMonth, int endMonth);

  ServerResponse<ArrayList<GeneralHeaderVO>> getJournalDetailTableHeader(String projectId, String rptType);

  ServerResponse<Page<Map<String, Object>>> getAccountCheckJournalDetail(int currentPage, int pageSize, String projectId, String rptType, String matchBatchId);

}
